import 'package:flutter/material.dart';
import 'package:flutter_smart_heating/ui/ui.dart';

class QrcodeResultView extends StatelessWidget {
  const QrcodeResultView({super.key, this.text});
  final String? text;
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        leading: const CloseButton(),
        title: const Text('扫描结果'),
        actions: [
          TextButton(
              onPressed: () {
                Ui.copyText(text);
              },
              child: const Text(
                '复制',
                style: TextStyle(color: Colors.white),
              ))
        ],
      ),
      body: SingleChildScrollView(
        padding: const EdgeInsets.all(20),
        child: Text(
          text ?? '',
          style: const TextStyle(fontSize: 14, height: 1.6),
        ),
      ),
    );
  }
}
